package lc4

import (
	"testing"
)

func Test_findMedianSortedArrays(t *testing.T) {
	type args struct {
		nums1 []int
		nums2 []int
	}
	tests := []struct {
		name string
		args args
		want float64
	}{
		{"2+1", args{[]int{1, 3}, []int{2}}, 2},
		{"2+2", args{[]int{1, 2}, []int{3, 4}}, 2.5},
		{"2+2same", args{[]int{0, 0}, []int{0, 0}}, 0},
		{"0+1", args{[]int{}, []int{1}}, 1},
		{"1+0", args{[]int{2}, []int{}}, 2},
		{"0+0", args{[]int{}, []int{}}, 0},
		{"0+2", args{[]int{}, []int{2, 3}}, 2.5},
		{"2+2_fushu", args{[]int{1, 2}, []int{-1, 3}}, 1.5},
		{"1+3", args{[]int{4}, []int{1, 2, 3}}, 2.5},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := findMedianSortedArrays(tt.args.nums1, tt.args.nums2); got != tt.want {
				t.Errorf("%v findMedianSortedArrays() = %v, want %v", tt.name, got, tt.want)
			}
		})
	}
}
